<?php

namespace app\shopConsole\validate;

use think\Validate;

class CategoryValidate extends Validate
{
    protected $rule = [
        'name|名字'       => 'require',
        'number|编号'     => 'require',
        'type|类型'       => 'require|number',
        'parent_id|级联ID'  => 'number',
        'ratio|商品系数'       => 'require|number',
        'shop_id|商户ID'    => 'require|number',
        'page|页码'          => 'require|number',
        'perPage|每页数量'   => 'require|number',
    ];

    protected $scene = [
        'create' => ['name', 'shop_id', 'parent_id', 'number', 'type', 'ratio'],
        'getPage' => ['type', 'page', 'perPage'],
        'get' => ['type'],
    ];

}